#include"alice.h"
//#include<cmath>
#include<fstream>

ALICE::ALICE(long v) : X(v) {
	std::ifstream DATA1("data.txt");
	DATA1 >> n >> e;
	
	//double tmp  = pow(static_cast<double>(X), static_cast<double>(e));
	//M = static_cast<long>(tmp) % n;
	int M = X;
	for(int i=1; i<e; i++){
		M *= X;
		if(M>=n) M %= n;
	}
	

	std::ofstream DATA2("code.txt");
	DATA2 << M;

	DATA1.close();
	DATA2.close();
}
